/*    */ package com.newcrm.webapi.sub;
/*    */ 
/*    */ import com.newcrm.bean.User;
/*    */ import com.newcrm.db.CustomerManager;
/*    */ import com.newcrm.exception.NotFoundException;
/*    */ import com.newcrm.util.Util;
/*    */ import com.newcrm.webapi.AbstractAction;
/*    */ import com.newcrm.webapi.AbstractHttpServlet;
/*    */ import java.io.IOException;
/*    */ import java.io.PrintWriter;
/*    */ import java.util.List;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import net.sf.json.JSONObject;
/*    */ 
/*    */ public class ListCustomersName extends AbstractAction
/*    */ {
/*    */   public ListCustomersName(AbstractHttpServlet servlet)
/*    */   {
/* 24 */     super(servlet);
/*    */   }
/*    */ 
/*    */   public void parse(HttpServletRequest request, HttpServletResponse response)
/*    */     throws IOException, ServletException, NotFoundException
/*    */   {
/* 30 */     CustomerManager manager = new CustomerManager();
/* 31 */     User user = super.getLoginUser(request);
/* 32 */     String ids = Util.getURLParameter(request.getParameter("ids"));
/*    */ 
/* 34 */     List items = manager.getCustomerName(
/* 35 */       user.companyId, ids);
/* 36 */     if ((items == null) || (items.size() == 0)) {
/* 37 */       super.showErrorMessage(response, "");
/* 38 */       return;
/*    */     }
/*    */ 
/* 41 */     response.setContentType("text/html;charset=utf-8");
/* 42 */     PrintWriter out = response.getWriter();
/* 43 */     JSONObject jsonObject = new JSONObject();
/* 44 */     jsonObject.put("items", items);
/* 45 */     out.println(jsonObject);
/* 46 */     out.flush();
/* 47 */     out.close();
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.sub.ListCustomersName
 * JD-Core Version:    0.6.1
 */